{include file="public/header" /}
<style>
    .new_dl {
        margin-right: 10px !important;
    }
</style>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.ds_wholesale}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get" name="formSearch">
        <div class="ds-search-form">
            <dl class="new_dl">
                <dt>{$Think.lang.ds_store_name}</dt>
                <dd><input type="text" value="{$Request.param.store_name}" name="store_name" id="store_name" class="txt"></dd>
            </dl>
            <dl class="new_dl">
                <dt>{$Think.lang.store_user}</dt>
                <dd><input type="text" value="{$Request.param.owner_and_name}" name="owner_and_name" id="owner_and_name" class="txt"></dd>
            </dl>
            <dl class="new_dl">
                <dt>{$Think.lang.belongs_level}</dt>
<!--                 <dd>
                    <select name="grade_id">
                        <option value="">{$Think.lang.ds_please_choose}...</option>
                        {notempty name="grade_list"}
                        {foreach name="grade_list" item="v" key="k" }
                        <option value="{$v.storegrade_id}" {if condition="$Request.param.grade_id eq $v.storegrade_id"}selected{/if}>{$v.storegrade_name}</option>
                        {/foreach}
                        {/notempty}
                    </select>
                </dd> -->
                <dd>
                    <select name="joinin_state">
                        <option value="">{$Think.lang.ds_please_choose}...</option>
                        {notempty name="joinin_state_array"}
                        {foreach name="joinin_state_array" item="v" key="k" }
                        <option value="{$k}" {$Request.param.joinin_state == $k ? 'selected' : ''}>{$v}</option>
                        {/foreach}
                        {/notempty}
                    </select>
                </dd>

            </dl>
            <dl class="new_dl">
                <dd>
                    <button style="height:30px; line-height: 30px;" type="submit" class="btn" >{$Think.lang.ds_search}</button>
                </dd>
                <dd>
                    <a style="height:28px; line-height: 28px;" href="{:url('Wholesale/store_joinin')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                </dd>
            </dl>
            <div class="btn_group">

            </div>
        </div>

    </form>
<!--    <div class="explanation" id="explanation">-->
<!--        <div class="title" id="checkZoom">-->
<!--            <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>-->
<!--            <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>-->
<!--        </div>-->
<!--        <ul>-->
<!--            <li>{$Think.lang.store_joinin_help1}</li>-->
<!--        </ul>-->
<!--    </div>-->

    <form method="post" id="store_form" name="store_form">
        <table class="ds-default-table">
            <thead>
                <tr class="thead">
                    <th class="w200">{$Think.lang.ds_store_name}</th>
                    <th class="w200">{$Think.lang.store_user_name}</th>
                    <th class="w200">{$Think.lang.register_time}</th>
                    <th class="w200">{$Think.lang.legal_person}</th>
                    <th class="w200">{$Think.lang.legal_person_phone}</th>
                    <th class="w200">{$Think.lang.location}</th>
                    <th class="w200">{$Think.lang.state}</th>
                    <th class="">{$Think.lang.ds_handle}</th>
                </tr>
            </thead>
            <tbody>
                {notempty name="store_list"}
                {foreach name="store_list" item="v" key="k" }
                <tr class="hover edit">
                    <td>{$v.store_name}</td>
                    <td>{$v.member_name}</td>
                    <td>{$v.add_time|date='Y-m-d H:i:s',###}</td>
                    <td>{$v.legal_person}</td>
                    <td>{$v.legal_person_phone}</td>
                    <td>{$v.company_address}</td>
                    <td>{$joinin_state_array[$v['joinin_state']]}</td>
                    <td>
                        <?php if(in_array(intval($v['joinin_state']), array(STORE_JOIN_STATE_NEW, STORE_JOIN_STATE_PAY))) { ?>
                        <a href="javascript:dsLayerOpen('{:url('Wholesale/store_joinin_detail',['member_id'=>$v.member_id])}','{$Think.lang.ds_verify}-{$v.store_name}', '100%', '100%')" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_verify}</a>
                        <?php } else { ?>
                        <a href="javascript:dsLayerOpen('{:url('Wholesale/store_joinin_detail',['member_id'=>$v.member_id])}','{$Think.lang.ds_view}-{$v.store_name}')" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
                        <?php } ?>
                        {if intval($v.joinin_state)<40}
                        &nbsp;&nbsp; <a href="javascript:dsLayerConfirm('{:url('Wholesale/del_join',['member_id'=>$v.member_id])}','{$Think.lang.ds_ensure_del}')" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a>
                        {/if}
                    </td>
                </tr>
                {/foreach}
                {else /}
                <tr class="no_data">
                    <td colspan="10">{$Think.lang.ds_no_record}</td>
                </tr>
                {/notempty}
            </tbody>
        </table>
        {$show_page}
    </form>
</div>
